<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class SwtBjOpen extends Model
{
    use HasDateTimeFormatter;

    protected $table = 'swt_bj_open';

    protected $guarded = [];
    protected $dates = ['open_time','close_time'];

    public function order()
    {
        return $this->belongsTo(SwtOrder::class, 'order_id');
    }

    public function replenish()
    {
        return $this->belongsTo(SwtReplenish::class, 'replenish_id');
    }

    public function machine()
    {
        return $this->belongsTo(SwtMachine::class, 'machine_id') -> withTrashed();
    }

}
